/*
 * @Author: huangwei
 * @Date: 2021-05-14 17:13:42
 * @LastEditors: 黄威
 * @LastEditTime: 2021-10-28 12:02:47
 * @Description: 绘画用的mixin
 */
import { Component } from 'vue-property-decorator'

import * as Cesium from 'Cesium'
import CesiumDraw from '@/utils/draw/CesiumDraw'
import { C3GraphicLayer } from '@/utils/bind-map/graphic'

import BaseDrawMixin from '../BindMap/BaseDrawMixin'

@Component
export default class DrawMixin extends BaseDrawMixin<
    CesiumDraw,
    C3GraphicLayer
> {
    _initDrawMixin(map: Cesium.Viewer) {
        this.drawIns = new CesiumDraw(map)
        this.drawLayer = new C3GraphicLayer(this as any)

        this._initTip(
            map.container.children[0] as HTMLElement,
            'mgs-c-view-tip'
        )
    }

    newGraphicLayer() {
        return new C3GraphicLayer(this as any)
    }
}
